home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 October: Mac OS SDK / Dev.CD Oct 97 SDK1.toast / Development Kits (Disc 1) / QuickDraw GX / Programming Stuff / Sample Code / Printing Samples / Printer Drivers… / ImageWriter--DTP renamer / ChooserSupport.r < prev    next >
Encoding:
Text File  |  1996-06-15  |  6.6 KB  |  253 lines  |  [TEXT/MPS ]

  1. /*
  2.     ChooserSupport.r -    other resources needed in order for driver to work
  3.                         with the Chooser.
  4.     
  5.     Copyright © 1992-1996 Apple Computer, Inc.
  6.     All rights reserved.
  7.  
  8.      6/14/96        cn            Updated to support Universal Interfaces 2.1.
  9.      8/26/94        dmh            Updated to 1.0.1 driver sources for SDK.
  10.      6/23/94        dmh            Added overrides for renaming DTPs.
  11.      3/22/94        dmh            Updated for the b4 seed.
  12.     12/20/93        dmh            Sync'd with the shipping 1.0b3 GX driver.
  13. */
  14.  
  15. #include "Types.r"
  16. #include "SysTypes.r"
  17. #include "GXPrintingResTypes.r"
  18.  
  19. //--------------------------------------------------------------------------------------------
  20. // THINGS TO CONTROL THE DEFAULT CHOOSING MECHANSIM
  21. //--------------------------------------------------------------------------------------------
  22.  
  23. // what type of communication does this device use (this is the default, as the actual
  24. // value can be found in the desktop printer).
  25. resource 'look' (-4096, sysheap, purgeable) {
  26.     2,                // use the second in our list by default
  27.     
  28.     {
  29.     "AppleTalk",    -4096,        isAppleTalk,                "ImageWriter";
  30.     "Serial",        -4095,        iconCells,                    "Modem Port";
  31.     "Servers",        -4094,        isAppleTalk+isPrinterShare,    "ImageWriterIIIS";
  32.     };
  33. };
  34.  
  35.  
  36. resource 'comm' (-4096, sysheap, purgeable) {
  37.     PAP
  38.         {
  39.         1,
  40.         "",
  41.         0, 0, 0, 0
  42.         };
  43. };
  44.  
  45. resource 'comm' (-4095, sysheap, purgeable) {
  46.     Serial
  47.         {
  48.         baud9600,        /* Output baud rate */
  49.         noParity,        /* Output parity */
  50.         twoStop,        /* Output stop bits */
  51.         data8,            /* Output data size */
  52.         0xFFFF1113,        /* Output handshaking */
  53.         0x00000000,
  54.         baud9600,        /* Input baud rate */
  55.         noParity,        /* Input parity */
  56.         twoStop,        /* Input stop bits */
  57.         data8,            /* Input data bits */
  58.         0xFFFF1113,        /* Input handshaking */
  59.         0x00000000,
  60.         1024,            /* Input buffer size */
  61.         ".AIn",            /* Input driver name */
  62.         ".AOut"            /* Output driver name */
  63.         };
  64. };
  65.  
  66. resource 'comm' (-4094, sysheap, purgeable) {
  67.     PrinterShare
  68.         {
  69.         "",
  70.         0
  71.         };
  72. };
  73.  
  74.     
  75.  
  76. //--------------------------------------------------------------------------------------------
  77. // STANDARD CHOOSER PACK STUFF
  78. //--------------------------------------------------------------------------------------------
  79.  
  80. // NBP Lookup type (maxed out so resource file won't need updating)
  81. resource 'STR ' (-4096, sysheap, purgeable)
  82. {
  83.     "XXXXXXXXXXXXXXXXXXXXXX";
  84. };
  85.  
  86. // NBP timeout value
  87. type 'GNRL'
  88. {
  89.     byte;    // timeout
  90.     byte;    // retries
  91. };
  92.  
  93. resource 'GNRL' (-4096, sysheap, purgeable)
  94. {
  95.     11,
  96.     5
  97. };
  98.  
  99. // title string (we'll put a control here, so we don't want a title)
  100. resource 'STR ' (-4091, sysheap, purgeable)
  101. {
  102.     "";
  103. };
  104.  
  105. // "left" button title
  106. resource 'STR ' (-4093, sysheap, purgeable)
  107. {
  108.     "Create";
  109. };
  110.  
  111. // rectangle list
  112. resource 'nrct' (-4096, sysheap, purgeable) {
  113.     {
  114.     {112, 251, 132, 311};            // left button
  115.     {0,0,0,0};                        // right button
  116.     {-101, 180, -101+20, 400};        // on button (location of device list - popup is placed here)
  117.     {0,0,0,0};                        // off button
  118.     {0,0,0,0};                        // button label
  119.     };
  120. };
  121.  
  122. // Menu used to select between direct connect, AppleTalk, and Servers
  123. resource 'MENU' (-4096, sysheap, purgeable)
  124. {
  125.     -4096,
  126.     textMenuProc,
  127.     0xFFFFFFFF,    
  128.     enabled,
  129.     "",
  130.     {
  131.     }
  132. };
  133.  
  134. // Pop-up control used to select between direct connect printers and those being shared on the network
  135. resource 'CNTL' (-4096, sysheap, purgeable)
  136. {
  137.     {0, 0, 20, 213},                            // zero based control location
  138.     0,                                            // Title options 0 = Left justified
  139.     visible,                                    // Should we display the control?
  140.     95,                                            // Title Width
  141.     -4096,                                        // 'MENU' to display
  142.     popupMenuCDEFproc+popupFixedWidth,            // CDEF = CDEFID * 16 + varCode
  143.     0,                                             // refCon = ResType to append = None
  144.     "Connect via:"                                // Control title
  145. };
  146.  
  147. resource 'DITL' (-4096, sysheap, purgeable) 
  148. {
  149.     {
  150.         {3, 238, 23, 238 + 213}, 
  151.             Control {enabled, -4096},
  152.     };
  153. };
  154.  
  155. resource 'DITL' (-4095, sysheap, purgeable) {
  156.     {    /* array DITLarray: 2 elements */
  157.         /* [1] */
  158.         {143, 310, 163, 368},
  159.         Button {
  160.             enabled,
  161.             "OK"
  162.         },
  163.         /* [2] */
  164.         {23, 87, 119, 377},
  165.         StaticText {
  166.             disabled,
  167.             "This printer driver could not be used.\n\n"
  168.             "Quitting one or more applications and then "
  169.             "trying again may allow you to use this "
  170.             "printer driver."
  171.         }
  172.     }
  173. };
  174.  
  175. resource 'ALRT' (-4095, sysheap, purgeable) {
  176.     {30, 30, 30+175, 30+380},
  177.     -4095,
  178.     {    /* array: 4 elements */
  179.         /* [1] */
  180.         OK, visible, sound1,
  181.         /* [2] */
  182.         OK, visible, sound1,
  183.         /* [3] */
  184.         OK, visible, sound1,
  185.         /* [4] */
  186.         OK, visible, sound1
  187.     },
  188.     alertPositionParentWindowScreen
  189. };
  190.  
  191. //-----------------------------------------------------------------------------------
  192. // CHOOSER PACK HELP RESOURCES
  193. //-----------------------------------------------------------------------------------
  194.  
  195.  
  196. /*    Any Chooser package can get balloons on all items that are normally 
  197.     added to the Chooser dialog by containing a STR# resource of 
  198.     resource ID = PackResID (-5694) and following the convention below:
  199.         
  200.         resource 'STR#' (-5694, sysheap, purgeable) {
  201.           {        "kEnabledLeftButton";    // message for button (or control) that is Enabled but not checked
  202.                 "kDisabledLeftButton";    // message for the control that is Disabled
  203.                 "kCheckedLeftButton";    // message for the control that is Checked (ie CtrlValue>0)
  204.                 "kOtherLeftButton";        // message for the control that is Other (ie CtrlValue>1)
  205.                 "kEnabledRightButton";
  206.                 "kDisabledRightButton";
  207.                 "kCheckedRightButton";
  208.                 "kOtherRightButton";
  209.                 "kEnabledOnButton";
  210.                 "kDisabledOnButton";
  211.                 "kCheckedOnButton";
  212.                 "kOtherOnButton";
  213.                 "kEnabledOffButton";
  214.                 "kDisabledOffButton";
  215.                 "kCheckedOffButton";
  216.                 "kOtherOffButton";
  217.                 "kEnabledOnOffTitle";
  218.                 "kDisabledOnOffTitle";
  219.                 "kCheckedOnOffTitle";
  220.                 "kOtherOnOffTitle";
  221.           }
  222.         };
  223.         
  224.     This is a horrible Chooser hack for 7.0 - but we'll follow along in GX.
  225. */
  226.  
  227. resource 'STR#' (-5694, sysheap, purgeable) {
  228.   {        
  229.   
  230.           "Click here to create a desktop printer for the selected device."; // message for button (or control) that is Enabled but not checked
  231.         "You have not selected a device to create, or there is not enough memory to create a desktop printer at this time.";    // message for the control that is Disabled
  232.         "";    // message for the control that is Checked (ie CtrlValue>0)
  233.         "";    // message for the control that is Other (ie CtrlValue>1)
  234.         "";    // kEnabledRightButton
  235.         "";    // kDisabledRightButton
  236.         "";    // kCheckedRightButton
  237.         "";    // kOtherRightButton
  238.         "Use this pop–up menu to select the type of connection for the desktop printer you are creating.";
  239.         "";    // kDisabledOnButton
  240.         "";    // kCheckedOnButton 
  241.         "";    // kOtherOnButton
  242.         "";    // kEnabledOffButton
  243.         "";    // kDisabledOffButton
  244.         "";    // kCheckedOffButton
  245.         "";    // kOtherOffButton
  246.         "";    // kEnabledOnOffTitle
  247.         "";    // kDisabledOnOffTitle
  248.         "";    // kCheckedOnOffTitle
  249.         "";    // kOtherOnOffTitle
  250.   }
  251. };
  252.  
  253.